#include <stdio.h>
#include <stdlib.h>
#include <signal.h>

void int_handler(int s)
{
    printf("Get SIGINT\n");
    exit(0);
}

void alrm_handler(int s)
{
    static int a = 0;
    alarm(1);
    printf("Get SIGALRM\n");
    if (a >= 10 )
        abort();
    a++;
}

int main()
{
    signal(SIGALRM, alrm_handler);

    alarm(1);
    char a;
    while (1)
    {
        a = getchar();
        putchar(a);
    }
    return 0;
}